@import 'config';
@function selectorToString($selector) {
    // 把选择器转换为字符串，比如把.el-scrollbar,选择器转为(.el-scrollbar,),
    // 然后通过str-slice截取出.el-scrollbar, 说白了这句话的意思就是把选择器转为
    // 字符串，因为转为字符串会多出括号，那就要去掉括弧啊
    $selector: inspect($selector);
    $selector: str-slice($selector, 2, -2);
    @return $selector;
}
// 判断选择器(.el-scrollbar_wrap--active)是否包含'--'
@function containsModifier($selector) {
    $selector: selectorToString($selector);
    @if str-index($selector, $modifier-separator) {
        @return true;
    } @else {
        @return false;
    }
}
// 判断选择器(.el-scrollbar__wrap.is-active)是否包含'is'
@function containWhenFlag($selector) {
    $selector: selectorToString($selector);
    @if str-index($selector, '.' + $state-prefix) {
        @return true;
    } @else {
        @return false;
    }
}
// 判断选择器(.el-scrollbar__wrap:before)是否包含伪元素(:hover)
@function containPseudoClass($selector) {
    $selector: selectorToString($selector);
    @if str-index($selector, ':'){
        @return true;
    } @else {
        @return false;
    }
}
@function hitAllSpecialNestRule($selector) {
    @debug hitAllSpecialNest $selector containsModifier($selector) or containWhenFlag($selector) or containPseudoClass($selector);
    @return containsModifier($selector) or containWhenFlag($selector) or containPseudoClass($selector);
}